package com.itlangzi.mybatis.factory;


import com.itlangzi.mybatis.page.Pagination;

public class PaginationHelper {

    private static ThreadLocal<Pagination> threadLocal = new ThreadLocal<>();

    public static <T> void setPagination(Pagination<T> pagination){
        threadLocal.set(pagination);
    }

    @SuppressWarnings("unchecked")
    public static <T> Pagination<T> getPagination(){
        return threadLocal.get();
    }

    public static void clear(){
        threadLocal.remove();
    }


}
